<div class="list-client">

    <div class="button-new">
        <?php
        echo CHtml::link('<i class="icon-white icon-plus-sign"></i> '.Yii::t('app', 'Add new'), array('task/add'), array('class' => 'btn btn-success'));
        ?>
    </div>
    <div id="ajaxmessagetxt">
        <?php
        $flashMessages = Yii::app()->user->getFlashes();
        if ($flashMessages) {
            foreach($flashMessages as $key => $message) {
                echo '<div class="alert alert-' . $key . ' fade in"><button type="button" class="close" data-dismiss="alert">×</button>' . $message . "</div>\n";
            }
        }
        ?>
    </div>

    <?php
    //    $this->widget('zii.widgets.grid.CGridView', array(
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id'=> 'task',
        'dataProvider'=>$model->search(),
        'filter' => $model,
        'enableSorting' => false,
        'type' => 'striped',
        'rowCssClassExpression' => '
            ( Common::compareDeadline($data->deadline) ? "tr_deadline" : "")
        ',
        'columns'=>array(
            'id_task',
            array(
                'name' => 'id_client',
                'value'=> 'Common::getValue($data->id_client, Client::getListClient())',
                'filter' => Client::getListClient(),
            ),
            array(
                'name' => 'id_contact',
                'value'=> 'Common::getValue($data->id_contact, ContactPerson::getListContact())',
                'filter' => $listContact,
            ),
            array(
                'name' => 'status',
                'value'=> 'Common::getValue($data->status, Constant::getStatus())',
                'filter' => Constant::getStatus(),
//                'evaluateHtmlOptions'=>true,
                'cssClassExpression'=>'"hnx-".Constant::getStatustag($data->status)',
            ),
            array(
                'name'=> 'deadline',
                'cssClassExpression'=>'(Common::compareDeadline($data->deadline) ? "deadline" : "")',

//                'rowHtmlOptionsExpression' => array('class'=>'demo-xuanhoa'),
            ),
            'responsible',
//            array(
//                'name' => 'responsible',
//                'value'=> 'Common::getValue($data->responsible, Admin::getListAnalyster())',
//                'filter' => $listAnalyst
//            ),
            array(
                'name' => 'id_attribute',
                'value'=> 'Common::getValue($data->id_attribute, Attribute::getListAttribute())',
                'filter' => $listAttributeMatter
            ),
            'id_by_matter',
            array(
                'name'=> 'date_upd',
                'value' => 'date("Y-m-d", strtotime($data->date_upd))',

            ),
            array(
                'class'=>'bootstrap.widgets.TbButtonColumn',
                'template' => '{view} {update} {delete}',
                'htmlOptions' => array('align'=>'center'),
                'afterDelete'=>'function(link,success,data){ if(success) $("#ajaxmessagetxt").html(data); }',
            ),
        ),
    ));
    ?>
</div>